package org.example.security.client.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.security.RolesAllowed;

@RestController
@RequestMapping
public class AdminController {

    @RolesAllowed("admin")
    @GetMapping("/admin")
    public String admin() {
        return "OK!";
    }

    @RolesAllowed("super_admin")
    @GetMapping("/super_admin")
    public String superAdmin() {
        return "OK!";
    }

}
